package cn.webrx;

public class T {
    public static void main(String[] args) {
        var i = 30; //int
        var c = .5;  //double

        //右移运算
        System.out.println(16>>2);// 4
        System.out.println(Integer.toBinaryString(16)); //0001 0000    100


        //左移运算
        System.out.println(3<<2); //12
        System.out.println(3*2);//6
        System.out.println(3<<1); //3*2  6

        System.out.println(Integer.toBinaryString(3)); //11   3<<2  就变1100
        System.out.println(Integer.toBinaryString(12));//1100


        //12 1100
        // 5 0101
        // 4 0100
        System.out.println(12&4);//4
        System.out.println(0B0100);//4
        System.out.println(0B100);//4

        System.out.println(6&3);
        System.out.println(Integer.toBinaryString(6));//110
        System.out.println(Integer.toBinaryString(3));//011
        System.out.println(0b10);  //0 1     0  1  10  11 100 101
        System.out.println(0b101);
    }
}
